import http from "@/http"
import { Category, CategoryListParm } from "./CategoryModel"

// 新增
export const addCategoryApi = (parm: Category) => {
    return http.post('/api/category', parm)
}

export const listApi = (parm: CategoryListParm) => {
    return http.get('/api/category/list', parm)
}

export const editCaegoryApi = (parm: Category) => {
    return http.put('/api/category', parm)
}

export const deleteCategoryApi = (parm: Category) => {
    return http.delete(`/api/category/${parm.categoryId}`)
}